﻿
@using ClassModel
@using ClassCommon
@using ClassBLL

@{
    int userid = HttpCookieHelper.GetUserID();
    // if (userid == -1) HttpContext.Current.Response.Redirect("/Home"); // 没有登录直接重定向到首页

    //ViewBag.currentLoginer = this.CurrentUser;
    ViewBag.UserId = userid;
    t_classDemo_UserInfo userInfo = t_classDemo_UserInfo_BLL.GetUserInfoById(userid);
    ViewBag.user = userInfo;
    
     t_class_attachment_info attachInfo = t_class_attachment_info_BLL.GetAttachmentByUserId(userid);
}

<header>
    <ul>
        <li>
            <a href="/Home">
                <img src="/static/newestHTML/assets/css/images/index2/logo.png" /></a>
        </li>
    </ul>
    <ul class="common_header">
        <li class="logout">退出</li>
        <li>|</li>
        <li class="administrator">@(userInfo.userAccount)</li>
        <li>欢迎您</li>
        <li>|</li>
        <li>@(attachInfo != null ? attachInfo.SchoolName : "还未设置基本信息")</li>
        <li>学校</li>
    </ul>
</header>

<style type="text/css">
    .common_header li {
        cursor:pointer !important;
    }
</style>

<script type="text/javascript">
    // 点击退出按钮
    $(function () {
        $(".logout").on("click", function () {
            window.location.href = "/Home/Logout";
        })
    })
</script>
